function Person1() {
    this.name = 'icoder';
    this.age = 18;
    // 属性访问函数
    this.getAge = function () {
        return this.age;
    }
}

const p1 =  new Person1();
const a = p1.getAge();

function Person2() {
    this.name = 'icoder';
    this.age = 18;
}

const p2 = new Person2();
const b = p2.age;